Swarm Design System Documentation

MWC to Swarm-UI Migration Docs



Below are a few examples of migrating simple and complex components from meetup-web-components to Swarm-UI.



RadioButton example



Before, using meetup-web-components:

import RadioButton from 'meetup-web-components/lib/forms/RadioButton';

<RadioButton
    name="option"
    value="1"
    checked={true}
    className={text('className', '')}
    label={text('label', 'This is a radio')}
/>


After, using swarm-ui:

import { Button } from '@meetup/swarm-components';

<Radio
    name="swarm"
    label="swarm"
    value="1"
    checked={true}
    onChange={(e) => alert(e.target.value)} />


Swarm UI examples













RadioButtonGroup example



Before, using meetup-web-components:

import RadioButton from 'meetup-web-components/lib/forms/RadioButton';
import RadioButtonGroup from 'meetup-web-components/lib/forms/RadioButtonGroup';

    <RadioButtonGroup
        name="radioButtonGroup"
        onChange={action('radio button change')}
        className={classNameKnob}
        direction={directionKnob}
        selectedValue={selectedValueKnob}
    >
        <RadioButton value="one" label="Option 1" name="radioButton" />
        <RadioButton value="two" label="Option 2" name="radioButton" />
        <RadioButton value="three" label="Option 3" name="radioButton" />
    </RadioButtonGroup>


After, using swarm-ui:

export const GroupRadioButtonsExample = () => {
  const [shape, setShape] = React.useState('circle');

  React.useEffect(() => console.log(shape));

  return(
    <>
      <Radio
        name='shape'
        label="Circle"
        id='circle'
        value='circle'
        onChange={(e) => setShape(e.target.value)}
        checked={shape === 'circle'}
      />
      <Radio
        name="shape"
        label="Square"
        id='square'
        value='square'
        onChange={(e) => setShape(e.target.value)}
        checked={shape === 'square'}
      />
      <Radio
        name="shape"
        label="Triangle"
        id='triangle'
        value='triangle'
        onChange={(e) => setShape(e.target.value)}
        checked={shape === 'triangle'}
      />
    </>
  );
};


Swarm UI example

alert--smallalertannounce--smallannouncearchive--smallarchivearrow-left--smallarrow-leftarrow-right--smallarrow-rightaudio--smallaudiobadge--smallbadgeblock--smallblockbolt--smallboltcalendar--smallcalendar-check--smallcalendar-checkcalendar-cross--smallcalendar-crosscalendar-plus--smallcalendar-pluscalendarcamera--smallcameracheck--smallcheck-circle--smallcheck-circlecheckchevron-down--smallchevron-downchevron-left--smallchevron-leftchevron-right--smallchevron-rightchevron-up--smallchevron-upclock--smallclock-arrow--smallclock-arrowclockcog--smallcogconversation--smallconversationcopy--smallcopycreditcard--smallcreditcardcross--smallcross-circle--smallcross-circlecross-circled--smallcross-circledcrossdownload--smalldownloaddrinks--smalldrinksedit--smalleditexport--smallexportexternal-facebookexternal-facebookboxedexternal-flickrexternal-gmailexternal-instagramexternal-linkedinexternal-mediumexternal-messenger-outlined--smallexternal-messenger-outlinedexternal-outlookexternal-tumblrexternal-twitter-outlined--smallexternal-twitter-outlinedexternal-twitterexternal-yahooexternal-youtubefilter--smallfilterfolder--smallfolderglobe--smallglobegrid--smallgridgroups--smallgroupsheart--smallheart-outline--smallheart-outlinehearthide--smallhidehome--smallhomeinfo--smallinfoinvite--smallinvite-filled--smallinvite-filledinvitelaunch-new-window--smalllaunch-new-windowlink--smalllinklist--smalllistlocation-pin--smalllocation-pin-filled--smalllocation-pin-filledlocation-pin-slashed--smalllocation-pin-slashedlocation-pinlocation-services--smalllocation-serviceslock--smalllockmail--smallmailmeetup-m--smallmeetup-mmessages--smallmessagesmicrophone--smallmicrophoneminus--smallminusnotifications--smallnotifications-badged--smallnotifications-badgednotifications-mute--smallnotifications-mutenotificationsoverflow--smalloverflow-vertical--smalloverflow-verticaloverflowphoto-album--smallphoto-album-add--smallphoto-album-addphoto-albumplay--smallplayplus--smallplus-circle--smallplus-circleplusprofile--smallprofileprofiles--smallprofilesprojector--smallprojectorpulse--smallpulserefresh--smallrefreshreply--smallreplysearch--smallsearchsend--smallsendsent-messages--smallsent-messagesshow--smallshowsort-direction--smallsort-directionstar--smallstar-rounded--smallstar-roundedstartextblock--smalltextblockticket--smalltickettrash--smalltrashtune--smalltunetv--smalltvupdates--smallupdateswifi--smallwifi